<template>
  <a-card :bordered="false" class="card-area">
    <div :class="advanced ? 'search' : null">
      <!-- 搜索区域 -->
      <a-form layout="horizontal">
        <div :class="advanced ? null : 'fold'">
          <a-row>
            <a-col :md="12" :sm="24">
              <a-form-item label="法人行" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
                <a-select mode="default" :allowClear="true" style="width: 100%" @change="handleInstChange"
                  v-model="queryParams.instId">
                  <a-select-option v-for="r in instIdData" :key="r.label">{{ r.label }}-{{ r.value }}</a-select-option>
                </a-select>
                <!--                <a-input v-if="!this.user.admin" v-model="queryParams.instId" :value="this.user.instId"
                         readonly="readonly"/>-->
              </a-form-item>
            </a-col>
            <a-col :md="12" :sm="24" v-show="queryParams.instId != ''">
              <a-form-item label="商户内部号" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
                <a-input placeholder="商户内部号、终端打印商户名称、终端编号..." v-model="queryParams.infoMTT" />
              </a-form-item>
            </a-col>
          </a-row>
        </div>
        <div style="text-align: center;" v-show="queryParams.instId != ''">
          <a-button type="primary" @click="search">查询</a-button>
          <a-button style="margin-left: 8px" @click="reset">重置</a-button>
        </div>
      </a-form>
    </div>
    <div v-show="queryParams.instId != ''">
      <div class="operator">
        <a-button v-hasPermission="['info:add']" ghost type="primary" @click="add">新增</a-button>
        <a-button v-hasPermission="['info:cancel']" ghost type="primary" @click="cancel">注销</a-button>
        <a-button v-hasPermission="['info:stopUse']" ghost type="primary" @click="stopUse">停用</a-button>
        <a-button v-hasPermission="['info:use']" ghost type="primary" @click="use">启用</a-button>
        <a-button v-hasPermission="['info:import']" ghost type="primary" @click="upload">导入</a-button>
        <a-button v-hasPermission="['info:resetKey']" ghost type="primary" @click="resetKey">重置密钥</a-button>
      </div>
      <!-- 表格区域 -->
      <a-table ref="TableInfo" :columns="columns" :rowKey="record => record.id" :dataSource="dataSource"
        :pagination="pagination" :loading="loading"
        :rowSelection="{ onChange: onSelectChange, selectedRowKeys: selectedRowKeys, type: 'radio' }"
        :scroll="{ x: 2200 }" @change="handleTableChange">
        <template slot="email" slot-scope="text, record">
          <a-popover placement="topLeft">
            <template slot="content">
              <div>{{ text }}</div>
            </template>
            <p style="width: 150px;margin-bottom: 0">{{ text }}</p>
          </a-popover>
        </template>
        <template slot="operation" slot-scope="text, record">
          <a-icon v-hasPermission="['info:edit']" type="setting" theme="twoTone" twoToneColor="#4a9ff5"
            @click="editInfo(record)" title="修改"></a-icon>&nbsp;
          <a-icon v-hasPermission="['info:view']" type="eye" theme="twoTone" twoToneColor="#42b983"
            @click="viewInfo(record)" title="查看"></a-icon>
          <a-badge v-hasNoPermission="['info:edit', 'info:view']" userStatus="warning" text="无权限"></a-badge>
        </template>

      </a-table>
      <!-- 信息查看 -->
      <info-info @close="handleInfoInfoClose" :infoInfoVisiable="infoInfo.visiable" :infoInfoData="this.infoInfo.data">
      </info-info>
      <!-- 新增信息 -->
      <info-add @close="handleInfoAddClose" @success="handleInfoAddSuccess" :infoAddVisiable="infoAdd.visiable"
        :instId="this.queryParams.instId">
      </info-add>
      <!-- 注销信息 -->
      <info-cancel @close="handleInfoCancelClose" @success="handleInfoCancelSuccess"
        :infoCancelVisiable="infoCancel.visiable" :infoCancelData="this.infoCancel.data">
      </info-cancel>
      <!-- 停用信息 -->
      <info-stop-use @close="handleInfoStopUseClose" @success="handleInfoStopUseSuccess"
        :infoStopUseVisiable="infoStopUse.visiable" :infoStopUseData="this.infoStopUse.data">
      </info-stop-use>
      <!-- 使用信息 -->
      <info-use @close="handleInfoUseClose" @success="handleInfoUseSuccess" :infoUseVisiable="infoUse.visiable"
        :infoUseData="this.infoUse.data">
      </info-use>
      <!-- 信息导入 -->
      <info-import @close="handleInfoImportClose" :infoUploadVisiable="infoUpload.visiable"
        :instId="this.queryParams.instId">
      </info-import>

      <!-- 修改信息 -->
      <info-edit ref="infoEdit" @close="handleInfoEditClose" @success="handleInfoEditSuccess"
        :infoEditVisiable="infoEdit.visiable" :instId="this.queryParams.instId">
      </info-edit>
    </div>
  </a-card>
</template>

<script>
import RangeDate from '@/components/datetime/RangeDate';
import InfoAdd from "./InfoAdd";
import InfoEdit from "./InfoEdit";
import InfoInfo from "./InfoInfo";
import InfoImport from "./InfoImport";
import InfoCancel from "./InfoCancel";
import InfoUse from "./InfoUse";
import InfoStopUse from "./InfoStopUse";

import { mapState } from "vuex"

export default {
  name: "info",
  components: { RangeDate, InfoAdd, InfoEdit, InfoInfo, InfoImport, InfoCancel, InfoUse, InfoStopUse },
  data() {
    return {
      advanced: false,
      infoInfo: {
        visiable: false,
        data: {}
      },
      infoAdd: {
        visiable: false
      },
      infoCancel: {
        visiable: false,
        data: {}
      },
      infoStopUse: {
        visiable: false,
        data: {}
      },
      infoUse: {
        visiable: false,
        data: {}
      },
      infoUpload: {
        visiable: false
      },
      infoEdit: {
        visiable: false
      },

      queryParams: {
        infoMTT: '',
        instId: ''
      },
      dataSource: [],
      sortedInfo: null,
      paginationInfo: null,
      selectedRowKeys: [],
      pagination: {
        pageSizeOptions: ['10', '20', '30', '40', '100'],
        defaultCurrent: 1,
        defaultPageSize: 10,
        showQuickJumper: true,
        showSizeChanger: true,
        showTotal: (total, range) => `显示 ${range[0]} ~ ${range[1]} 条记录，共 ${total} 条记录`
      },
      loading: false,
      instIdData: [],
      da: []
    }
  },
  computed: {
    ...mapState({
      user: state => state.account.user,

    }),
    columns() {
      let { sortedInfo } = this
      sortedInfo = sortedInfo || {}
      let { filteredInfo } = this
      filteredInfo = filteredInfo || {}
      return [{
        title: '商户内部号',
        dataIndex: 'mchntNo',
        scopedSlots: { customRender: 'mchntNo' },
      }, {
        title: '终端打印商户名',
        dataIndex: 'termPrintMerName',
        scopedSlots: { customRender: 'termPrintMerName' },
      }, {
        title: '收单机构',
        dataIndex: 'posInst',
        scopedSlots: { customRender: 'posInst' },
      }, {
        title: '终端编号',
        dataIndex: 'termNo',
        scopedSlots: { customRender: 'termNo' },
      }, {
        title: '序列号',
        dataIndex: 'sn',
        scopedSlots: { customRender: 'sn' },
      }, {
        title: '终端类型',
        dataIndex: 'termType',
        customRender: (text, row, index) => {
          switch (text) {
            case '01':
              return <a-tag color="pink" > 传统POS </a-tag>
            case '02':
              return <a-tag color="pink" > 有线拨号POS </a-tag>
            case '03':
              return <a-tag color="pink" > 电话POS </a-tag>
            case '04':
              return <a-tag color="cyan" > 智能POS </a-tag>
            case '05':
              return <a-tag color="pink" > mPOS </a-tag>
            case '06':
              return <a-tag color="pink" > 无线POS </a-tag>
            case '07':
              return <a-tag color="pink" > mis终端 </a-tag>
            default:
              return text
          }
        },
        // filters: [
        //   { text: '传统POS', value: '01' },
        //   { text: '有线拨号POS', value: '02' },
        //   { text: '电话POS', value: '03' },
        //   { text: '智能POS', value: '04' },
        //   { text: 'mPOS', value: '05' },
        //   { text: '无线POS', value: '06' },
        //   { text: 'mis终端', value: '07' }
        // ],
        // filterMultiple: false,
        // filteredValue: filteredInfo.termType || null,
        // onFilter: (value, record) => record.termType.includes(value)
      }, {
        title: '终端主密钥下载标识',
        dataIndex: 'keyDownFlag',
        scopedSlots: { customRender: 'keyDownFlag' },
      }, {
        title: '终端状态',
        dataIndex: 'termStatus',
        customRender: (text, row, index) => {
          switch (text) {
            case '00':
              return <a-tag color="cyan" > 非正式 </a-tag>
            case '01':
              return <a-tag color="pink" > 正式 </a-tag>
            case '02':
              return <a-tag color="pink" > 停用 </a-tag>
            case '03':
              return <a-tag color="pink" > 已注销 </a-tag>
            default:
              return text
          }
        },
        // filters: [
        //   { text: '非正式', value: '00' },
        //   { text: '正式', value: '01' },
        //   { text: '停用', value: '02' },
        //   { text: '已注销', value: '03' }
        // ],
        // filterMultiple: false,
        // filteredValue: filteredInfo.termStatus || null,
        // onFilter: (value, record) => record.termStatus.includes(value)
      }, {
        title: '终端受理状态',
        dataIndex: 'auditStatus',
        customRender: (text, row, index) => {
          switch (text) {
            case '00':
              return <a-tag color="cyan" > 待提交审批 </a-tag>
            case '01':
              return <a-tag color="pink" > 新增-审批流程中 </a-tag>
            case '02':
              return <a-tag color="pink" > 新增-审批通过 </a-tag>
            case '03':
              return <a-tag color="pink" > 新增-审批拒绝 </a-tag>
            case '11':
              return <a-tag color="cyan" > 注销-审批流程中 </a-tag>
            case '12':
              return <a-tag color="pink" > 注销-审批通过 </a-tag>
            case '13':
              return <a-tag color="pink" > 注销-审批拒绝 </a-tag>
            case '21':
              return <a-tag color="pink" > 停用-审批流程中 </a-tag>
            case '22':
              return <a-tag color="cyan" > 停用-审批通过 </a-tag>
            case '23':
              return <a-tag color="pink" > 停用-审批拒绝 </a-tag>
            case '31':
              return <a-tag color="pink" > 启用-审批流程中 </a-tag>
            case '32':
              return <a-tag color="pink" > 启用-审批通过 </a-tag>
            case '33':
              return <a-tag color="cyan" > 启用-审批拒绝 </a-tag>
            case '41':
              return <a-tag color="pink" > 修改-审批流程中 </a-tag>
            case '42':
              return <a-tag color="pink" > 修改-审批通过 </a-tag>
            case '43':
              return <a-tag color="pink" > 修改-审批拒绝 </a-tag>
            default:
              return text
          }
        },
        // filters: [
        //   { text: '待提交审批', value: '00' },
        //   { text: '新增-审批流程中', value: '01' },
        //   { text: '新增-审批通过', value: '02' },
        //   { text: '新增-审批拒绝', value: '03' },
        //   { text: '注销-审批流程中', value: '11' },
        //   { text: '注销-审批通过', value: '12' },
        //   { text: '注销-审批拒绝', value: '13' },
        //   { text: '停用-审批流程中', value: '21' },
        //   { text: '停用-审批通过', value: '22' },
        //   { text: '停用-审批拒绝', value: '23' },
        //   { text: '启用-审批流程中', value: '31' },
        //   { text: '启用-审批通过', value: '32' },
        //   { text: '启用-审批拒绝', value: '33' },
        //   { text: '修改-审批流程中', value: '41' },
        //   { text: '修改-审批通过', value: '42' },
        //   { text: '修改-审批拒绝', value: '43' }
        // ],
        // filterMultiple: false,
        // filteredValue: filteredInfo.auditStatus || null,
        // onFilter: (value, record) => record.auditStatus.includes(value)
      }, {
        title: '操作',
        dataIndex: 'operation',
        fixed: 'right',
        scopedSlots: { customRender: 'operation' }
      }]
    }
  },
  mounted() {
    this.$get('admin/upmporg/getInstList').then((r) => {
      this.instIdData = r.data
    })
  },
  methods: {
    onSelectChange(selectedRowKeys) {  //接收数组，存放到前面定义的数组中
      this.selectedRowKeys = selectedRowKeys;
    },

    add() {
      this.infoAdd.visiable = true
    },

    cancel() {
      if (!this.selectedRowKeys.length) {
        this.$message.warning('请选择需要注销的记录')
        return
      }
      let selectedIndex = ''
      this.dataSource.map((val, index) => {
        // console.log(val.id, this.selectedRowKeys[0])
        if (val.id === this.selectedRowKeys[0]) return selectedIndex = index
      })
      let record = this.dataSource[selectedIndex]
      if (record.auditStatus === '01' || record.auditStatus === '11' || record.auditStatus === '21'
        || record.auditStatus === '31' || record.auditStatus === '41') {
        this.$message.warning('审批流程中的数据不允许注销')
        return
      }
      if (record.termStatus !== '01' && record.termStatus !== '02') {
        this.$message.warning('非正式、已注销不能注销')
        return
      }
      if (record.auditStatus === '12') {
        this.$message.warning('注销通过的数据不允许再注销')
        return
      }
      // console.log(record)
      this.getBrandName(record)
      this.getModelName(record)
      this.getProvince(record)
      this.getCity(record)
      this.getArea(record)

      this.infoCancel.data = record
      this.infoCancel.visiable = true
    },
    stopUse() {
      if (!this.selectedRowKeys.length) {
        this.$message.warning('请选择需要停用的数据')
        return
      }
      let selectedIndex = ''
      this.dataSource.map((val, index) => {
        if (val.id === this.selectedRowKeys[0]) return selectedIndex = index
      })
      let record = this.dataSource[selectedIndex]
      if (record.auditStatus === '01' || record.auditStatus === '11' || record.auditStatus === '21'
        || record.auditStatus === '31' || record.auditStatus === '41') {
        this.$message.warning('审批流程中的数据不允许停用')
        return
      }
      if (record.termStatus !== '01') {
        this.$message.warning('非正式、停用、注销不能停用')
        return
      }
      if (record.auditStatus === '22') {
        this.$message.warning('停用的数据不允许再停用')
        return
      }
      // console.log(record)
      this.getBrandName(record)
      this.getModelName(record)
      this.getProvince(record)
      this.getCity(record)
      this.getArea(record)

      this.infoStopUse.data = record
      this.infoStopUse.visiable = true
    },

    use() {
      if (!this.selectedRowKeys.length) {
        this.$message.warning('请选择需要启用的数据')
        return
      }

      let selectedIndex = ''
      this.dataSource.map((val, index) => {
        // console.log(val.id, this.selectedRowKeys[0])
        if (val.id === this.selectedRowKeys[0]) return selectedIndex = index
      })
      let record = this.dataSource[selectedIndex]
      if (record.auditStatus === '01' || record.auditStatus === '11' || record.auditStatus === '21'
        || record.auditStatus === '31' || record.auditStatus === '41') {
        this.$message.warning('审批流程中的数据不允许启用')
        return
      }
      if (record.termStatus !== '02') {
        this.$message.warning('"非正式、正式、注销不能启用"')
        return
      }

      // console.log(record)
      this.getBrandName(record)
      this.getModelName(record)
      this.getProvince(record)
      this.getCity(record)
      this.getArea(record)

      this.infoUse.data = record
      this.infoUse.visiable = true
    },

    resetKey() {
      // console.log(this.selectedRowKeys)
      if (!this.selectedRowKeys.length) {
        this.$message.warning('请选择需要重置密钥的间联信息')
        return
      }
      let selectedIndex = ''
      this.dataSource.map((val, index) => {
        // console.log(val.id, this.selectedRowKeys[0])
        if (val.id === this.selectedRowKeys[0]) return selectedIndex = index
      })

      if (this.dataSource[selectedIndex].keyDownFlag != "已下载") {
        this.$message.warning('终端主密钥未下载，不能重置')
        return
      }
      let that = this
      this.$confirm({
        title: '确定重置终端主密钥为未下载吗？',
        content: '当您点击确定按钮后，这些终端主密钥将会重置',
        centered: true,
        onOk() {
          let info = {}
          info.instId = that.dataSource[selectedIndex].instId
          info.mchntNo = that.dataSource[selectedIndex].mchntNo
          info.termNo = that.dataSource[selectedIndex].termNo
          info.keyType = '00'
          that.$delete('info/resetKey', {
            ...info
          }).then(() => {
            that.$message.success('重置终端主密钥成功')
            that.search()
            that.selectedRowKeys = []
          })
        },
        onCancel() {
          that.selectedRowKeys = []
        }
      })
    },


    upload() {
      this.infoUpload.visiable = true
    },
    handleInstChange(value) {
      this.queryParams.instId = value;
      if (value != "") {
        let params = {}
        params.instId = value;
        this.$get('info/', { ...params }).then((r) => {

          this.dataSource = r.data.rows;
          this.search();
        })
      }
    },



    handleInfoAddClose() {
      this.infoAdd.visiable = false
    },
    handleInfoAddSuccess() {
      this.infoAdd.visiable = false
      this.$message.success('新增间联信息成功')
      this.search()
    },

    handleInfoStopUseClose() {
      this.infoStopUse.visiable = false
      this.search()
    },
    handleInfoStopUseSuccess() {
      this.infoStopUse.visiable = false
      this.$message.success('停用间联信息成功')
      this.search()
    },
    handleInfoCancelClose() {
      this.infoCancel.visiable = false
      this.search()
    },
    handleInfoCancelSuccess() {
      // console.log(this.infoCancel.visiable, 'rrr')
      this.infoCancel.visiable = false
      this.$message.success('注销间联信息成功')
      this.search()
    },
    handleInfoUseClose() {
      this.infoUse.visiable = false
      this.search()
    },
    handleInfoUseSuccess() {
      this.infoUse.visiable = false
      this.$message.success('启用间联信息成功')
      this.search()
    },


    handleInfoImportClose() {
      this.infoUpload.visiable = false
      this.search()
    },
    viewInfo(record) {
      this.getBrandName(record)
      this.getModelName(record)
      this.getProvince(record)
      this.getCity(record)
      this.getArea(record)
      this.setTermType(record)
      this.setTermDevcTp(record)

      this.infoInfo.data = record

      this.infoInfo.visiable = true
    },
    handleInfoInfoClose() {
      this.infoInfo.visiable = false
      this.infoInfo.data = {}
      this.search()
    },
    getBrandName(record) {
      let brandCode = record.brandCode
      this.$get('terminalAdmin/getByBrandCode', { brandCode: brandCode }).then((r) => {
        record.brandCode = r.data.brandCode + '-' + r.data.brandName
      })
    },
    getModelName(record) {
      let brandCode = record.brandCode
      let modelCode = record.modelCode
      this.$get('modelAdmin/getByModelCode', { brandCode: brandCode, modelCode: modelCode }).then((r) => {
        record.modelCode = r.data.modelCode + '-' + r.data.modelName
      })
    },
    getProvince(record) {
      let q = record.termAddrPrvnc
      let l = '01'
      this.$get('/admin/merParam/regionInfo/select3', { l: l, q: q }).then((r) => {
        record.termAddrPrvnc = r.data.regionCode + '-' + r.data.regionName
      })

    },
    getCity(record) {
      let p = record.termAddrPrvnc
      let q = record.termAddrCity
      let l = '02'
      this.$get('/admin/merParam/regionInfo/select3', { l: l, p: p, q: q }).then((r) => {
        record.termAddrCity = r.data.regionCode + '-' + r.data.regionName
      })

    },
    getArea(record) {
      let p = record.termAddrCity
      let q = record.termAddrArea
      let l = '03'
      this.$get('/admin/merParam/regionInfo/select3', { l: l, p: p, q: q }).then((r) => {
        record.termAddrArea = r.data.regionCode + '-' + r.data.regionName
      })

    },
    setTermType(record) {
      switch (record.termType) {
        case '01':
          return record.termType = '传统POS'
        case '02':
          return record.termType = '有线拨号POS'
        case '03':
          return record.termType = '电话POS'
        case '04':
          return record.termType = '智能POS'
        case '05':
          return record.termType = 'mPOS'
        case '06':
          return record.termType = '无线POS'
        case '07':
          return record.termType = 'mis终端'
      }
    },
    setTermDevcTp(record) {
      switch (record.termDevcTp) {
        case '01':
          return record.termDevcTp = '智能 POS'
        case '02':
          return record.termDevcTp = '传统 POS (外接扫码/显码设备或内置扫码/显码模块)'
        case '03':
          return record.termDevcTp = '收银机(外接扫码/显码设备或内置扫码/显码模块)'
        case '04':
          return record.termDevcTp = '自助收银终端(支持扫码或显码功能)'
        case '05':
          return record.termDevcTp = '智能移动设备（包含手机、PAD）'
        case '06':
          return record.termDevcTp = '其他设备'
      }
    },



    editInfo(record) {
      this.getBrandName(record)
      this.getModelName(record)
      this.getProvince(record)
      this.getCity(record)
      this.getArea(record)
      if (record.auditStatus === '01' || record.auditStatus === '11' || record.auditStatus === '21'
        || record.auditStatus === '31' || record.auditStatus === '41') {
        this.$confirm({
          title: '提示',
          content: '申请待审批的数据不允许修改',
        });
      } else if (record.termStatus === '02' || record.termStatus === '03') {
        this.$confirm({
          title: '提示',
          content: '停用、注销终端不能修改',
        });
      } else {
        // console.log(record)
        setTimeout(() => {
          this.$refs.infoEdit.setInfoFormValues(record)
        }, 1000);
        this.infoEdit.visiable = true
      }
    },

    handleInfoEditSuccess() {
      this.infoEdit.visiable = false
      this.$message.success('修改间联信息成功')
      this.search()
    },

    handleInfoEditClose() {
      this.infoEdit.visiable = false
      this.search()
    },

    search() {
      this.$refs.TableInfo.pagination.current = this.pagination.defaultCurrent
      if (this.paginationInfo) {
        this.paginationInfo.current = this.pagination.defaultCurrent
        this.paginationInfo.pageSize = this.pagination.defaultPageSize
      }

      let { sortedInfo, filteredInfo } = this
      let sortField, sortOrder
      // 获取当前列的排序和列的过滤规则
      if (sortedInfo) {
        sortField = sortedInfo.field
        sortOrder = sortedInfo.order
      }
      let params = {}
      params.instId = this.queryParams.instId
      params.mchntNo = this.queryParams.infoMTT
      params.termPrintMerName = this.queryParams.infoMTT
      params.posInstCd = this.queryParams.infoMTT

      this.fetch({
        sortField: sortField,
        sortOrder: sortOrder,
        ...params,
        ...filteredInfo
      })
    },
    reset() {
      // 取消选中
      this.selectedRowKeys = []
      // 重置分页
      this.$refs.TableInfo.pagination.current = this.pagination.defaultCurrent
      if (this.paginationInfo) {
        this.paginationInfo.current = this.pagination.defaultCurrent
        this.paginationInfo.pageSize = this.pagination.defaultPageSize
      }
      // 重置列排序规则
      this.sortedInfo = null
      // 重置查询参数
      this.queryParams = {}
      // // 清空时间选择
      // this.$refs.createTime.reset()
      this.fetch()
    },
    handleTableChange(pagination, filters, sorter) {
      this.$refs.TableInfo.pagination.current = this.pagination.defaultCurrent
      if (this.paginationInfo) {
        this.paginationInfo.current = this.pagination.defaultCurrent
        this.paginationInfo.pageSize = this.pagination.defaultPageSize
      }

      // 将这三个参数赋值给Vue data，用于后续使用
      this.paginationInfo = pagination
      this.filteredInfo = filters
      this.sortedInfo = sorter

      this.fetch({
        sortField: sorter.field,
        sortOrder: sorter.order,
        ...this.queryParams,
        ...filters
      })
    },
    fetch(params = {}) {
      this.loading = true
      if (this.paginationInfo) {
        // 如果分页信息不为空，则设置表格当前第几页，每页条数，并设置查询分页参数
        this.$refs.TableInfo.pagination.current = this.paginationInfo.current
        this.$refs.TableInfo.pagination.pageSize = this.paginationInfo.pageSize
        params.pageSize = this.paginationInfo.pageSize
        params.pageNum = this.paginationInfo.current
      } else {
        // 如果分页信息为空，则设置为默认值
        params.pageSize = this.pagination.defaultPageSize
        params.pageNum = this.pagination.defaultCurrent
      }
      this.$get('info', {
        ...params
      }).then((r) => {
        let data = r.data
        const pagination = { ...this.pagination }
        pagination.total = data.total
        this.dataSource = data.rows
        this.pagination = pagination
        this.loading = false
      })
    }
  }
}
</script>

<style lang="less" scoped>
@import "../../../../../../static/less/Common";
</style>

